Fix Zap trades recording wrong user address#617
Merged
realproject7 merged 1 commit intomainfrom Mar 27, 2026
Merged
Conversation
Change user attribution from args.user to args.receiver in all three trade indexing routes. Filter out intermediate Zap self-mints where receiver is the Zap contract (HUNT→PLOT conversion step). Backfill route updated to also fix existing rows where user_address equals the Zap contract — re-decodes tx receipts to extract correct receiver, deletes intermediate Zap self-mint entries. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
project7-interns
approved these changes
Mar 27, 2026
Collaborator
project7-interns
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Summary
The PR fixes the Zap-trade attribution bug by switching the trade-history user field from args.user to args.receiver in the live indexers and in the backfill path, while also removing intermediate Zap self-mint rows instead of preserving them as user trades.
Findings
- None.
Decision
Approved because the change matches issue #613, is scoped to the three affected trade routes, and preserves direct-trade behavior while correcting both new and historical Zap-attributed rows.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #613
/api/index/trade): Useargs.receiverinstead ofargs.userforuser_address. Filter out intermediate Zap self-mints wherereceiveris the Zap contract./api/cron/trade-history): Same fix —args.receiverand Zap self-mint filter inprocessTradeEvent()./api/backfill-user-address): Now also picks up rows whereuser_address = ZAP_PLOTLINK(not just NULL). Re-decodes tx receipts to extract correctreceiver. Deletes intermediate Zap self-mint entries.receiverequals the actual trader for direct MCV2_Bond interactions.Test plan
🤖 Generated with Claude Code